<template>
<van-cell :to="'/technicDetail/' + item.id" class="article-item">
  <div class="item">
    <div class="content">
        <div class="title">{{item.title}}</div>
        <div class="info">
            <div class="time">{{timeChange(item.created_at)}}</div>
            <div class="see">
                <van-icon name="eye-o" class="eye" />
                <span>{{item.read}}</span>
            </div>
            <div class="zan">
                <van-icon name="good-job-o" class="eye"/>
                <span>{{item.star}}</span>
            </div>
        </div>
    </div>
    <div class="cover">
        <img :src="'http://hmmm.zllhyy.cn'+item.cover" alt="">
    </div>
  </div>
</van-cell>
</template>

<script>
export default {
  props: {
    item: {
      // 必传
      required: true,
      // 类型必须是Object，否则也会报错
      type: Object
    }
  },
  data () {
    return {
    }
  },

  methods: {
    timeChange (data) {
      let time = data // 将需要格式化的数据传入
      time = this.dayjs(time).format('YYYY-MM-DD')
      return time
    }

  }
}
</script>

<style lang="less" scoped>
.item{
    height: 75px;
    padding-bottom: 30px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    .content{
        width: 216px;
        height: 75px;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        .title{
            font-weight: 700;
            font-size: 16px;
            padding-bottom: 2px;
        }
        .info{
          line-height: 1;
            font-size: 12px;
            display: flex;
            justify-content: space-between;
            color: #b4b4bc;
            .eye{
                margin-right: 8px;
            }
        }
    }
    .cover{
        img{
            width: 113px;
            height: 75px;
        }
    }
}
.article-item{
  margin: 0;
  padding: 0;
}

</style>
